package com.weitu.risk.service.impl;

import com.weitu.risk.entity.RiskLevel;
import com.weitu.risk.mapper.RiskLevelMapper;
import com.weitu.risk.service.RiskLevelService;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RiskLevelServiceImpl implements RiskLevelService {
    @Autowired
    private RiskLevelMapper riskLevelMapper;

    @Override
    public boolean addRiskLevel(Map<String, Object> map) {
        int flag = this.riskLevelMapper.addRiskLevel(map);
        if(flag<1){
            return false;
        }
        return true;
    }

    @Override
    public List<RiskLevel> queryRiskLevelListByParam(Map<String, Object> map) {
        return this.riskLevelMapper.queryRiskLevelListByParam(map);
    }

    @Override
    public int queryRiskLevelListCountByParam(Map<String, Object> map) {
        return this.riskLevelMapper.queryRiskLevelListCountByParam(map);
    }

    @Override
    public RiskLevel queryRiskLevelById(Map<String,Object> map) {
        return this.riskLevelMapper.queryRiskLevelById(map);
    }

    @Override
    public boolean deleteRiskLevelById(String id) {
        int flag= this.riskLevelMapper.deleteRiskLevelById(id);
        if(flag<1){
            return false;
        }
        return true;
    }

    @Override
    public boolean editRiskLevelById(Map<String,Object> map) {
        int flag = this.riskLevelMapper.editRiskLevelById(map);
        if(flag<1){
            return false;
        }
        return true;
    }
}